*for REStat paper "Breastfeeding and Children's Early Cognitive Outcomes."

/* PSID DATA CENTER *****************************************************
   JOBID            : 126490                            
   DATA_DOMAIN      : CDS                               
   USER_WHERE       : NULL                              
   FILE_TYPE        : CDS Kids Only                     
   OUTPUT_DATA_TYPE : ASCII                             
   STATEMENTS       : SAS Statements                    
   CODEBOOK_TYPE    : HTML                              
   N_OF_VARIABLES   : 6                                 
   N_OF_OBSERVATIONS: 3563                              
   MAX_REC_LENGTH   : 17                                
   DATE & TIME      : May 25, 2011 @ 13:19:54
************************************************************************/
libname dd 'X:\Donnanew';

FILENAME pgest08 "X:\Donnanew\pgest08.txt" ;

DATA x ;
   ATTRIB
      ER30001  FORMAT=F4.   LABEL="1968 INTERVIEW NUMBER"                   
      ER30002  FORMAT=F3.   LABEL="PERSON NUMBER                         68"
      ER33401  FORMAT=F5.   LABEL="1997 INTERVIEW NUMBER"                   
      ER33402  FORMAT=F2.   LABEL="SEQUENCE NUMBER                       97"
      ER33403  FORMAT=F2.   LABEL="RELATION TO HEAD                      97"
      Q1A7     FORMAT=F1.   LABEL="BABY BORN ON TIME 97"                    
   ;
   INFILE pgest08 LRECL = 17 ; 
   INPUT 
      ER30001      1 - 4     ER30002      5 - 7     ER33401      8 - 12   
      ER33402     13 - 14    ER33403     15 - 16    Q1A7        17 - 17   

   ;

data dd.pgest08;
set x;
keep childid q1a7;
*first, form child unique id;
childid = .;
childid = er30001*1000 + er30002;

proc means;
run ;
